import { createBrowserRouter } from 'react-router-dom'
import Home from '@/pages/Home'
import AuthRoute from '@/components/AuthRoute'
import Article from '../pages/Article'
import Publish from '../pages/Publish'
import Data from '../pages/Data'
import Login from '../pages/Login'

const router = createBrowserRouter([
  { path: '/login', 
    element: <Login /> },
  {
    path: '/',
    element: <AuthRoute> <Home /> </AuthRoute>,
    children: [
      {
        index: true,
        element: <Data />,
      },
      {
        path: 'article',
        element: <Article />,
      },
      {
        path: 'publish',
        element: <Publish />,
      },
    ],
  },
])

export default router